define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'order/index',
        add_url: 'order/add',
        edit_url: 'order/edit',
        delete_url: 'order/delete',
        export_url: 'order/export',
        modify_url: 'order/modify',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'third_number', title: '配送平台订单号'},
                    {field: 'sys_number', title: '骑手系统订单号'},
                    {field: 'call_number', title: '调用方订单号'},
                    {field: 'app_type', search: 'select', selectList: notes?.app_type || {}, title: '第三方平台类型'},
                    {field: 'appoint_type', search: 'select', selectList: notes?.appoint_type || {}, title: '预约类型'},
                    {field: 'store_id', title: '配送店铺ID'},
                    {field: 'total_distance', title: '总距离，单位：米'},
                    {field: 'total_fee_after_save', title: '实际支付的费用，单位：分'},
                    {field: 'status', search: 'select', selectList: notes?.status || {}, title: '订单状态'},
                    {field: 'create_time', search: 'range', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});